import pysolr



if __name__ == '__main__':
    zookeeper = pysolr.ZooKeeper("CDH-master:2181,CDH-slave1:2181,CDH-slave2:2181/solr")
    solr_con =  pysolr.SolrCloud(zookeeper,"hbaseSolr")
    docs = []
    doc = {
        "id":"row996",
        "name":"asdasd",
        "city":"sx",
        "salary":"16000"
    }
    docs.append(doc)
    doc1 = {
        "id": "row995",
        "name": "asdasd",
        "city": "sx",
        "salary": "16000"
    }
    docs.append(doc1)
    results = solr_con.add(docs=docs)
    print('插入成功')